<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>资金转换</title>
    <script src="/static/mobile/js/mui.min.js"></script>
    <link href="/static/mobile/css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="/static/mobile/css/basic.css"/>
    <link rel="stylesheet" type="text/css" href="/static/mobile/css/huiyuan_zhuanzhang.css"/>
    <script type="text/javascript" src="/static/mobile/js/jquery.js"></script>
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <script type="text/javascript" charset="utf-8">
        mui.init();
    </script>
    <style>
        .section2 .sub button {
            width: 100%;
            padding: 5px;
            font-size: 1rem;
            color: #fff;
            background: #E52D2D;
            border-color: #E52D2D;
        }
    </style>
</head>
<body>
<div class="sectionx">
    <header class="mui-bar mui-bar-nav" >
        <a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.back(-1)" style="color: #4E4E4E;"></a>
        <h1 class="mui-title">资金转换</h1>
        <a class="mui-icon mui-icon  mui-pull-right right1" href="{:url('user/set/zhuanhuan_record')}" style="color: #4E4E4E;font-size: 0.8rem;padding-top: 18px;">转换记录</a>
    </header>
</div>
<div class="section3">
    <div class="container">
        <div class="section3-1">
            <img src="/static/mobile/images/monmon.png"/>
        </div>
        <div class="section3-2 mui-clearfix">
            <ul>
                <li style="width:100%;" id="type_jifen">
                    <p class="p1">{$user.money_jifen}</p>
                    <p class="p2">{$type1|tixiantype}</p>
                </li>
                <li  id="type_qian" style="display: none;width:100%;">
                    <p class="p1">{$user.money_qian}</p>
                    <p class="p2">{$type2|tixiantype}</p>
                </li>
                <li  id="type_benjin" style="display: none;width:100%;">
                    <p class="p1">{$user.money_benjin}</p>
                    <p class="p2">{$type3|tixiantype}</p>
                </li>
                <li  id="type_qita" style="display: none;width:100%;">
                    <p class="p1">{$user.money_qita}</p>
                    <p class="p2">{$type4|tixiantype}</p>
                </li>
                <li  id="type_baodan" style="display: none;width:100%;">
                    <p class="p1">{$user.money_baodan}</p>
                    <p class="p2">{$type5|tixiantype}</p>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="ge"></div>
<div class="section2">
    <div class="layui-form">
        <form  method="post">
            <ul>
                <li class="mui-clearfix">
                    <span>转换类型</span>
                    <select name="type" id="txid"  lay-filter="type_change"  >
                        <option value="1">余额转报单币</option>
                    </select>
                </li>
                <li class="mui-clearfix">
                    <span>转换金额</span>
                    <input type="text" name='num' placeholder="请填写转换金额"/>
                </li>

            </ul>
            <div class="sub">
                <!--<input type="submit" value="转账"/>-->
                <button type="button" class="layui-btn" lay-filter="sub" lay-submit>转换</button>
            </div>
        </form>
    </div>
</div>


</body>
<script type="text/javascript" >
    mui('body').on( 'tap' , 'a' , function(){
        document.location.href=this.href;
    })
</script>

<script src="/static/plugins/layui/layui.js"></script>
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,$ = layui.jquery;
        // 登录提交监听
        form.on('submit(sub)', function (data) {
            var loading = layer.load(1, {shade: [0.1, '#fff']});
            $.post("{:url('zhuanhuan')}",data.field,function(res){
                layer.close(loading);
                if(res.code > 0){
                    layer.msg(res.msg,{time:1000,icon:1},function(){
                        location.href = "{:url('zhuanhuan')}";
                    });
                }else{
                    layer.msg(res.msg,{time:1000,icon:2});
                    // $('.captcha img').attr('src','{:url("verify")}?id='+Math.random());
                }
            });
        })
    })
</script>

<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,$ = layui.jquery;
        form.on('select(type_change)', function(data){
            var td=$("#txid").val();
            if(td==1){
                $("#type_jifen").css('display','block');
                $("#type_qian").css('display','none');
                $("#type_benjin").css('display','none');
                $("#type_qita").css('display','none');
                $("#type_baodan").css('display','none');
            } else if(td==2){
                $("#type_jifen").css('display','none');
                $("#type_qian").css('display','block');
                $("#type_benjin").css('display','none');
                $("#type_qita").css('display','none');
                $("#type_baodan").css('display','none');
            }else if(td==3){
                $("#type_jifen").css('display','none');
                $("#type_qian").css('display','none');
                $("#type_benjin").css('display','block');
                $("#type_qita").css('display','none');
                $("#type_baodan").css('display','none');
            }else if(td==4){
                $("#type_jifen").css('display','none');
                $("#type_qian").css('display','none');
                $("#type_benjin").css('display','none');
                $("#type_qita").css('display','block');
                $("#type_baodan").css('display','none');
            }else if(td==5){
                $("#type_jifen").css('display','none');
                $("#type_qian").css('display','none');
                $("#type_benjin").css('display','none');
                $("#type_qita").css('display','none');
                $("#type_baodan").css('display','block');
            }

        });
    })

</script>

</html>